
project , uses("constituency_elections.dta")



	use "constituency_elections.dta", clear //open data

	***Combine binscatters

	replace spending_limit_predicted_adj = 10*spending_limit_predicted_adj // report in £1,000
	replace spending_total_adj = spending_total_adj/1000 // report in £1,000
	binscatter spending_total_adj  spending_limit_predicted_adj ,  controls(county electors countyXelectors) n(20) title("More Costly Campaigns", size(medium)) xlabel(, labsize(medlarge) angle(45)) ylabel( 0(20)100 , labsize(medium)) xtitle("") ytitle("Spending" "(Residualized)", size(medlarge)) saving(./figures/binscatter_spending.gph, replace)	linetype(lfit)		
	binscatter effective_candidates  spending_limit_predicted_adj , controls(county electors countyXelectors) n(20) title("Fewer Candidates", size(medium)) xtitle("") ytitle("Candidates" "(Residualized)", size(medlarge))   ylabel( , labsize(medium)) xlabel(, labsize(medlarge) angle(45)) saving(./figures/binscatter_candidates.gph, replace)		linetype(lfit)	
	binscatter inc_spending_pct  spending_limit_predicted_adj , ylabel(45 (5) 60) controls(county electors countyXelectors) n(20) title("Greater Financial" "Incumbency Advantage", size(medium)) xlabel(, labsize(medlarge) angle(45))  ylabel( 40 (5) 60, labsize(medium)) xtitle("") ytitle("% Incumbent Spending" "(Residualized)", size(medlarge)) saving(./figures/binscatter_inc_spend.gph, replace)	 linetype(lfit)			
	binscatter inc_vote_pct  spending_limit_predicted_adj , ylabel(45 (5) 60) controls(county electors countyXelectors) n(20) title("Greater Electoral" "Incumbency Advantage", size(medium)) xlabel(, labsize(medlarge) angle(45))  ylabel(50 (5) 60, labsize(medium)) xtitle("") ytitle("% Incumbent Vote" "(Residualized)", size(medlarge)) saving(./figures/binscatter_inc.gph, replace)	 linetype(lfit)		
	
	
	graph combine  "./figures/binscatter_spending.gph"  "./figures/binscatter_candidates.gph" "./figures/binscatter_inc_spend.gph" "./figures/binscatter_inc.gph", xsize(20) ysize(20) xcommon   imargin(small)  b1title("Spending Limit, £1000" "(Residualized)", size(medsmall)) cols(2) 
	graph export ./figures/binscatter_combined.pdf, replace				
	project , creates("figures/binscatter_combined.pdf")	
		
		
		
